package com.thoughtworks;

import static java.lang.System.exit;

public class QuitAction implements Action {

    public void doAction(ActionParams actionParams) {
        String libraryNo = null;
        String checkedOutItem = null;
        for (Rental name : actionParams.library.userItemCheckoutMapping.keySet()) {
            checkedOutItem = name.getName();
            libraryNo = actionParams.library.userItemCheckoutMapping.get(name);
            actionParams.output.displayMessage(checkedOutItem + " is checked out by " + libraryNo);
    }
        exit(0);
   }
}
